package com.jic.filecenter.template;

import com.jic.common.base.vo.RestResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhoufeng
 * @Description: Controller模板
 * @date 2020-03-06 16:33
 *
 * idea类注释设置：打开：file->setting->Editor->Filr and Code Templates->Includes->File Header
 * /**
 *  * @Description:
 *  * @author zhoufeng
 *  * @date ${YEAR}-${MONTH}-${DAY} ${TIME}
 *  *
 *  （星号*）/
 *
 */
@RestController
@RequestMapping("/api")
public class TemplateController {

    @Autowired
    private TemplateUserServiceImpl userService;

    /**
     * 保存用户信息
     * 1、保存/修改 用 @PostMapping 请求类型
     * 2、查询 用 @GetMapping 请求类型
     * @param userRequest
     * @return
     */
    @PostMapping("/save/user")
    @ApiOperation(value = "保存/修改 用户信息")
    public RestResult<String> saveUser(@Validated @RequestBody TemplateUserRequest userRequest){
        return userService.saveUser(userRequest);
    }
}
